<template>
  <div>
      <ul class="todoMain list-group">
          <!-- 遍历数据，把 todObj对象传给子组件MyItem-->
          <MyItem 
            v-for="todObj in todos" 
            :key="todObj.id" 
            :todo="todObj" 
            :checkTodo="checkTodo" 
            :deleteTodo="deleteTodo"
          />
      </ul>     
  </div>
</template>

<script>
    import MyItem from './MyItem.vue'
    export default {
        name:'MyList',
        components:{
            MyItem
        },
        props:['todos','checkTodo','deleteTodo']

    }
</script>

<style scoped>
    .todoMain{
        margin: 0 auto;
        margin-top: 20px;
        width: 30%;
    }
</style>